cmake_minimum_required(VERSION 3.5.1)

set(PROTOS   
        calibration_table.proto
        control_cmd.proto
        control_conf.proto
        gain_scheduler_conf.proto
        lat_controller_conf.proto
        leadlag_conf.proto
        lon_controller_conf.proto
        mpc_controller_conf.proto
        pad_msg.proto
        pid_conf.proto
)
PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS ${PROTOS})


add_library(control_proto ${PROTO_SRCS} ${PROTO_HDRS})
target_include_directories(control_proto
    PUBLIC
    ${PROTOBUF_INCLUDE_DIRS}
    $<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}>)
target_link_libraries(control_proto ${PROTOBUF_LIBRARIES}
                                     canbus::proto
                                     common::proto
                                     localization::proto
                                     perception::proto
                                     prediction::proto
                                     routing::proto
                                     dreamview::proto
                                     map::relative_map_proto
                                     )
add_library(control::proto ALIAS control_proto)

install(TARGETS control_proto
        EXPORT apollo-export
        LIBRARY DESTINATION lib
        ARCHIVE DESTINATION lib
        RUNTIME DESTINATION bin
        INCLUDES DESTINATION .
        )
